package com.huiminpay.transaction.api;

import com.huiminpay.common.cache.domain.BusinessException;
import com.huiminpay.paymentagent.api.dto.PaymentResponseDTO;
import com.huiminpay.transaction.api.dto.PayOrderDTO;
import com.huiminpay.transaction.api.dto.QRCodeDto;

public interface TransactionService {
    /**
     * 生成支付入口的url
     * @param qrCodeDto  商户ID  应用ID,门店id,订单标题,订单描述
     * @return  支付入口的url
     * @throws BusinessException
     */
    String createStoreQRCode(QRCodeDto qrCodeDto) throws BusinessException;

    /**
     * 根据订单号查询订单信息
     * @param tradeNo  订单号
     * @return  订单信息
     * @throws BusinessException
     */
    PayOrderDTO queryPayOrder(String tradeNo) throws BusinessException;

    /**
     * 保存商户订单   调用支付渠道代理服务对接支付宝
     * @param payOrderDTO
     * @return
     * @throws BusinessException
     */
    PaymentResponseDTO<String> submitOrderByAli(PayOrderDTO payOrderDTO) throws BusinessException;

    /**
     * 更新订单
     * @param tradeNo   商户订单号
     * @param payChannelTradeNo   支付渠道交易流水号
     * @param tradeState   订单状态
     * @throws BusinessException
     */
    void updateOrderTradeNoAndTradeState(String tradeNo,String payChannelTradeNo,String tradeState) throws BusinessException;
}
